const app = getApp()
import {
  HomeIndex
} from 'index-modal.js';
import {
  Config
} from '../../../utils/config.js';
var Function = require("../../../utils/function.js");
var index = new HomeIndex(); //实例化 首页 对象
Page({
  data: {
    windowWidth:0,
    yanmi_du:{},
    numberSuc:true,
    hideJin:false,
    url:Config.Url,
    plove:{}
  },
  onLoad: function(options) {
    this.setData({id: options.id,plove:JSON.parse(options.plove)})
    this._linespeed()
  },
  _linespeed() {
    let that = this;
    let data = {
      id: that.data.id,
      uid: wx.getStorageSync('members').id
    }
    index.linespeed(data, (res) => {
      if (res.code == 200) {
        that.setData({
          yanmi_du: res.data
        })
      }
    })
  },
  showNum:function(){
    let that=this;
    that.setData({
      numberSuc:false
    })
  },
  showModal() {
    // this.setData({ hideJin: true })
    let that=this;
    app.globalData.type=1;
    wx.switchTab({
      url: '/pages/bill/noconsume/noconsume'
    })
  },
  hideModal() {
    this.setData({ hideJin: false })
  },

  openmap(){  //打开地图
    let that = this;
    wx.openLocation({
      latitude: that.data.lat,
      longitude: that.data.log,
      name:that.data.plove.goods_name,
      success:function(res){

      }
    })
  }
  
})